<template>
  <div class="login">
    <el-form
      disabled
      :model="formObj"
      class="login-form"
      size="small"
      :rules="formObjRules"
    >
      <el-form-item prop="username">
        <el-input v-model="formObj.username"></el-input>
      </el-form-item>
      <el-form-item prop="password">
        <el-input type="password" v-model="formObj.password"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button style="width: 100%" type="primary">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formObj: {
        username: "",
        password: "",
      },
      formObjRules: {
        username: [
          {
            required: true,
            message: "用户名不能为空",
            trigger: ["blur", "change"],
          },
        ],
        password: [
          {
            required: true,
            message: "密码不能为空",
            trigger: ["blur", "change"],
          },
        ],
      },
    };
  },
};
</script>

<style scoped lang="stylus">
.login
  height 100vh
  display flex
  justify-content center
  align-items center
  .login-form
    width 300px
</style>
